package com.usian.feign;

import com.usian.pojo.SearchItem;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author chen
 * @date 2021/1/19 - 10:40 - 星期二
 * @project usian_parent
 * @package com.usian.feign
 * @by GGbomd猪猪侠
 */
@Component
@FeignClient("usian-search-service")
public interface SearchItemFeign {

    /**
     * 导入商品库到Elasticsearch
     * 操作 tb_item  tb_item_cat  tb_item_desc 表
     * @return
     */
    @RequestMapping("/importAll")
    Boolean importAll();

    /**
     * 首页搜索
     * @param q 搜索条件
     * @param page 第几页
     * @param pageSize  显示几条
     * @return
     */
    @RequestMapping("/list")
    List<SearchItem> selectByq(@RequestParam String q,@RequestParam Integer page,@RequestParam Integer pageSize);
}
